BuildTarget=demo
currentpath=$(shell pwd)
compiler=g++

srcpath=$(currentpath)
incpath=$(currentpath)/../include
libpath=$(currentpath)/../lib

srcfiles=$(wildcard $(srcpath)/*.cc)
objfiles=$(patsubst %.cc,%.o,$(srcfiles))

$(warnning $(srcfiles))
depends=-lthreadpool -lboost_json -lglog
compflags=-c -g -fsanitize=address
sharedflags=-fsanitize=address -Wl,-rpath=./


all:$(BuildTarget)

clean:
	-rm -f *.o demo
	-rm ./log/*
	-rm core*

$(BuildTarget):$(objfiles)
	$(compiler) $(objfiles)  $(sharedflags) -L .  -o $(BuildTarget) $(depends)

%.o:%.cc
	$(compiler) $(compflags) -I $(incpath) $^ -o $@
